import java.util.Date;
import java.util.List;
import java.util.ArrayList;

// 客户类
class Customer {
    private String name;
    private String contact;
    private String deliveryAddress;
    private boolean active;

    // 构造函数
    public Customer(String name, String contact, String deliveryAddress, boolean active) {
        this.name = name;
        this.contact = contact;
        this.deliveryAddress = deliveryAddress;
        this.active = active;
    }

    // 获取姓名
    public String getName() {
        return name;
    }

    // 获取联系电话
    public String getContact() {
        return contact;
    }

    // 获取邮寄地址
    public String getDeliveryAddress() {
        return deliveryAddress;
    }

    // 获取激活状态
    public boolean isActive() {
        return active;
    }
}

// 订单类
class Order {
    private Date createDate;
    private String status;
    private List<OrderDetail> orderDetails;

    // 构造函数
    public Order(Date createDate, String status) {
        this.createDate = createDate;
        this.status = status;
        this.orderDetails = new ArrayList<>();
    }

    // 获取创建日期
    public Date getCreateDate() {
        return createDate;
    }

    // 获取订单状态
    public String getStatus() {
        return status;
    }

    // 添加订单详情
    public void addOrderDetail(OrderDetail orderDetail) {
        orderDetails.add(orderDetail);
    }

    // 获取订单详情列表
    public List<OrderDetail> getOrderDetails() {
        return orderDetails;
    }
}

// 订单详情类
class OrderDetail {
    private int quantity;
    private Product product;

    // 构造函数
    public OrderDetail(int quantity, Product product) {
        this.quantity = quantity;
        this.product = product;
    }

    // 获取数量
    public int getQuantity() {
        return quantity;
    }

    // 获取商品项
    public Product getProduct() {
        return product;
    }

    // 计算子总价
    public double calculateSubTotal() {
        return quantity * product.getPriceForQuantity(quantity);
    }

    // 计算重量
    public double calculateWeight() {
        return quantity * product.getWeight();
    }
}

// 商品项类
class Product {
    private String title;
    private double weight;
    private String description;

    // 构造函数
    public Product(String title, double weight, String description) {
        this.title = title;
        this.weight = weight;
        this.description = description;
    }

    // 获取名称
    public String getTitle() {
        return title;
    }

    // 获取重量
    public double getWeight() {
        return weight;
    }

    // 获取描述
    public String getDescription() {
        return description;
    }

    // 获取指定数量的商品价格
    public double getPriceForQuantity(int quantity) {
        // 这里需要根据具体的业务逻辑实现价格计算
        return 10.0; // 例如，每个商品价格为10.0元
    }
}

// 支付方式抽象类
abstract class Payment {
    protected double amount;

    // 构造函数
    public Payment(double amount) {
        this.amount = amount;
    }

    // 获取金额
    public double getAmount() {
        return amount;
    }
}

// 信用卡类
class Credit extends Payment {
    private String number;
    private String type;
    private Date expireDate;

    // 构造函数
    public Credit(double amount, String number, String type, Date expireDate) {
        super(amount);
        this.number = number;
        this.type = type;
        this.expireDate = expireDate;
    }

    // 获取卡号
    public String getNumber() {
        return number;
    }

    // 获取类型
    public String getType() {
        return type;
    }

    // 获取过期日期
    public Date getExpireDate() {
        return expireDate;
    }
}

// 现金类
class Cash extends Payment {
    private double cashTendered;

    // 构造函数
    public Cash(double amount, double cashTendered) {
        super(amount);
        this.cashTendered = cashTendered;
    }

    // 获取支付金额
    public double getCashTendered() {
        return cashTendered;
    }
}

// 在线转账类
class WireTransfer extends Payment {
    private String bankID;
    private String bankName;

    // 构造函数
    public WireTransfer(double amount, String bankID, String bankName) {
        super(amount);
        this.bankID = bankID;
        this.bankName = bankName;
    }

    // 获取银行ID
    public String getBankID() {
        return bankID;
    }

    // 获取银行名称
    public String getBankName() {
        return bankName;
    }
}

// 支付宝类
class AliPay extends Payment {
    private String number;

    // 构造函数
    public AliPay(double amount, String number) {
        super(amount);
        this.number = number;
    }

    // 获取卡号
    public String getNumber() {
        return number;
    }
}

// 微信支付类
class WeixinPay extends Payment {
    private String number;

    // 构造函数
    public WeixinPay(double amount, String number) {
        super(amount);
        this.number = number;
    }

    // 获取卡号
    public String getNumber() {
        return number;
    }
}

public class Main {
    public static void main(String[] args) {
        // 创建一个客户
        Customer customer = new Customer("John Doe", "123-456-7890", "123 Main St", true);

        // 创建一个商品项
        Product product = new Product("T-shirt", 0.2, "A stylish T-shirt");

        // 创建一个订单
        Order order = new Order(new Date(), "CREATE");

        // 创建一个订单详情
        OrderDetail orderDetail = new OrderDetail(2, product);
        order.addOrderDetail(orderDetail);

        // 创建一个支付方式
        Payment payment = new Credit(20.0, "1234567890123456", "VISA", new Date());

        // 打印订单信息
        System.out.println("Customer: " + customer.getName());
        System.out.println("Order Status: " + order.getStatus());
        System.out.println("Order Details:");
        for (OrderDetail detail : order.getOrderDetails()) {
            System.out.println("- Product: " + detail.getProduct().getTitle() +
                    " - Quantity: " + detail.getQuantity() +
                    " - Subtotal: " + detail.calculateSubTotal() +
                    " - Weight: " + detail.calculateWeight());
        }
        System.out.println("Payment Method: " + payment.getClass().getSimpleName());
        System.out.println("Payment Amount: " + payment.getAmount());
    }
}
